package com.greydawn.SimpleFactoryPattern;

/**
 * @Author: zhongwr
 * @Create: 2021/12/6 22:53
 * @Version 1.0
 * @Description: 形状工厂
 */
public class ShapeFactory {

    public Shape getShape(String name){
        if("circle".equalsIgnoreCase(name)){
            return new Circle();
        }
        if("rectangle".equalsIgnoreCase(name)){
            return new Rectangle();
        }
        return null;
    }
}
